package com.manager.common.quartz.impl;

import com.manager.common.quartz.IntervalScheduleTimeEnum;
import com.manager.common.quartz.JobEntity;
import org.quartz.Job;

import java.util.concurrent.TimeUnit;

public class IntervalJonEntity extends JobEntity {

    private Integer interval;

    private IntervalScheduleTimeEnum intervalScheduleTimeEnum;

    private Integer repeatNum;//调度次数

    public IntervalJonEntity() {

    }

    public IntervalJonEntity(String jobName, String aliasName, Class<? extends Job> jobClass,
                             Object jobParams,Integer interval, IntervalScheduleTimeEnum intervalScheduleTimeEnum) {

        this.jobName = jobName;
        this.aliasName = aliasName;
        this.jobClass = jobClass;
        this.jobParams = jobParams;
        this.interval = interval;
        this.intervalScheduleTimeEnum = intervalScheduleTimeEnum;
        this.repeatNum = -1;
    }

    public IntervalJonEntity(String jobName, String aliasName,  Class<? extends Job> jobClass,
                             Object jobParams,Integer interval, IntervalScheduleTimeEnum intervalScheduleTimeEnum, Integer repeatNum) {

        this.jobName = jobName;
        this.aliasName = aliasName;
        this.jobClass = jobClass;
        this.jobParams = jobParams;
        this.interval = interval;
        this.intervalScheduleTimeEnum = intervalScheduleTimeEnum;
        this.repeatNum = repeatNum;
    }

    public Integer getInterval() {
        return interval;
    }

    public void setInterval(Integer interval) {
        this.interval = interval;
    }

    public IntervalScheduleTimeEnum getIntervalScheduleTimeEnum() {
        return intervalScheduleTimeEnum;
    }

    public void setIntervalScheduleTimeEnum(IntervalScheduleTimeEnum intervalScheduleTimeEnum) {
        this.intervalScheduleTimeEnum = intervalScheduleTimeEnum;
    }

    public Integer getRepeatNum() {
        return repeatNum;
    }

    public void setRepeatNum(Integer repeatNum) {
        this.repeatNum = repeatNum;
    }
}
